package com.dongdongshop.controller;

import com.dongdongshop.service.BrandService;
import com.dongdongshop.service.CategoryService;
import com.dongdongshop.service.SpecificationService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class SkipController {

    @DubboReference
    private BrandService brandService;
    @DubboReference
    private SpecificationService specificationService;
    @DubboReference
    private CategoryService categoryService;

    //跳转品牌管理页面
    @RequestMapping("brand")
    public String brand(){
        return "admin/brand";
    }

    //跳转内容页面
    @RequestMapping("home")
    public String home(){
        return "admin/home";
    }

    //跳转商家审核页面
    @RequestMapping("seller_1")
    public String seller_1(){
        return "admin/seller_1";
    }

    //跳转商家管理页面
    @RequestMapping("seller")
    public String seller(){
        return "admin/seller";
    }

    //跳转规格管理页面
    @RequestMapping("specification")
    public String specification(){
        return "admin/specification";
    }

    //跳转模板管理页面
    @RequestMapping("type_template")
    public String type_template(Model model){

        model.addAttribute("brandList",brandService.findAll(null));
        model.addAttribute("specList",specificationService.findAll(null));

        return "admin/type_template";
    }

    //跳转分类管理页面
    @RequestMapping("item_cat")
    public String item_cat(){
        return "admin/item_cat";
    }

    //跳转商品审核页面
    @RequestMapping("goods")
    public String goods(){
        return "admin/goods";
    }

    //跳转 广告类型管理页面
    @RequestMapping("content_category")
    public String content_category(){
        return "admin/content_category";
    }

    //跳转广告管理页面
    @RequestMapping("content")
    public String content(Model model){
        model.addAttribute("categoryList",categoryService.getCategoryList(null));
        return "admin/content";
    }

}
